import React, { Component,lazy,Suspense } from 'react';
import { Route ,Switch,Redirect} from 'react-router-dom';
import Loding from '@/components/Loding'
const Welcome = lazy(()=>import('@/views/dashboard/Welcome'))
const Cinema = lazy(()=>import('@/views/dashboard/cinema/Index'))
const Film = lazy(()=>import('@/views/dashboard/film/Index'))
const User = lazy(()=>import('@/views/dashboard/user/Index'))
const College = lazy(()=>import('@/views/dashboard/college/Index'))
class Admin extends Component {
    render() {
        return (
            <Suspense fallback={<Loding/>}>
                <Switch>
                    <Route path='/dashboard/welcome' component={Welcome}></Route>
                    <Route path='/dashboard/cinema/Index' component={Cinema}></Route>
                    <Route path='/dashboard/film/index' component={Film}></Route>
                    <Route path='/dashboard/user/index' component={User}></Route>
                    <Route path='/dashboard/college/index' component={College}></Route>
                    <Redirect from='/dashboard' to='/dashboard/welcome'></Redirect>
                </Switch>
            </Suspense>
        );
    }
}

export default Admin;
